<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="__PUBLIC__/admin/sncss/css/style.css" rel="stylesheet" type="text/css" />
<link href="__PUBLIC__/admin/sncss/css/combo.select.css" rel="stylesheet" type="text/css" />

	<script language="javascript" type="text/javascript" src="__PUBLIC__/admin/datepicker/WdatePicker.js"></script>

<style type="text/css">
	.tablelink_red{color:#f00;}
</style>
	<script type="text/javascript">
        //时间选择
        function selecttime(flag){
            if(flag==1){
                var endTime = $("#countTimeend").val();
                if(endTime != ""){
                    WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate:endTime});
                }else{
                    WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
                }
            }else{
                var startTime = $("#countTimestart").val();
                if(startTime != ""){
                    WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',minDate:startTime});
                }else{
                    WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});
                }
            }
        }
	</script>
</head>


<body>

	<div class="place">
	<span>位置：</span>
	<ul class="placeul">
	<li><a>首页</a></li>
	<li><a>自媒体管理</a></li>
	<li><a>自媒体列表</a></li>
	<li><a onClick="javascript:history.back(-1);">返回</a></li>
	</ul>
	</div>

	<div class="rightinfo">
	<div class="tools">

	<form id="form1" name="form1" method="get" action="{:U('/Home/Media/media_list')}">
		<div style="float: left;">
			<select class="newselect" id="u1_input" name="labelkey" >
				<option selected value="0">请选择标签</option>
				<?php foreach ($labeldata as $key => $value) {?>
				<option  value="<?php echo $value['label_id'];?>" <?php if(isset($_GET['labelkey'])){if($_GET['labelkey'] == $value['label_id']){echo "selected='selected'";}}?>><?php echo $value['label_name'];?></option>
				<?php }?>
			</select>
		</div>
		<div style="float: left; margin-bottom: 15px;">
			<input name="user_name" style="height: 38px;" type="text" class="dfinput" placeholder="搜索编号/名称/手机号" id="user" value="<?php echo isset($_GET['user_name'])?$_GET['user_name']:"";?>" />
		</div>

		<div style="float: left; margin-bottom: 15px;">
			<input name="" style="height: 40px;" type="submit" class="btn" value="搜索"/>
		</div>

	</form>
		<div style="float: left; margin-bottom: 15px; margin-left: 10px; margin-right: 10px; line-height: 40px;">
			<!--<input name="subscript" type="checkbox" class="sminput" style="float: left; margin-top: 3px;" value="1" <?php echo isset($_GET['subscript'])?"checked":"";?> /><div style="float: left; line-height: 40px;">	已合作自媒体</div>-->
		</div>
	</div>
		<div class="tools">
			<form method="post" enctype="multipart/form-data" action="{:U('/Home/Export/media_new')}">
				<input type="text" style="width: 140px;" class="dfinput ordertimebody1" name="start" id="countTimestart" onfocus="selecttime(1)" value="<?php echo date("Y-m-d H:i:s",'');?>" size="17" class="date" readonly> - <input type="text" style="width: 140px;" class="dfinput ordertimebody2" name="end" id="countTimeend" onfocus="selecttime(2)" value="<?php echo date("Y-m-d H:i:s",'');?>" size="17"  class="date" readonly>
				<input type="hidden" name="user_name" value="{$user_name}">
				<input type="hidden" name="labelkey" value="{$labelkey}">
				<input type="hidden" name="subscript" value="{$subscript}">
				<!--<a href="{:U('/Home/Daochu/theorder')}" style="border:none;width:100px;height:40px; font-size:14px; cursor:pointer; line-height:40px;background:#61afdf;color:#fff;text-align:center;text-indent:0;display:block;float: left;margin-left: 5px;">导出</a>-->
				<input name="" type="submit" class="btn" value="导出"/>
				<!--<a href="javascript:form3_submit()" class="btn">导出</a>-->
			</form>
		</div>
	<table class="tablelist">
		<thead>
		<tr>
		<th>编号<i class="sort"></i></th>
		<th>名称</th>
		<if condition="$founder neq 4"><th>手机号</th></if>
		<th>类型</th>
		<th>签约权限</th>
		<th>交单时限</th>
		<th>签约期限</th>
		<th>签约主播</th>
		<th>创建时间</th>
		<th>操作</th>
		</tr>
		</thead>
		<tbody>

		<foreach name='medialist' item='v'>
		<tr>
		 <td>{$v.mmid}</td>
		  <td>{$v.media_name}</td>
		  <if condition="$founder neq 4"><td>{$v.media_tel}</td></if>
		  <td>{$v.articles_name}</td>
		  <td><if condition="$v.collectpower eq 0">无<else />{$v.wordnumber}+{$v.grantnumber}</if></td>
		  <td><if condition="$v.collectpower eq 0">无<else />{$v.signtimelimit}小时</if></td>
			<td><if condition="$v.collectpower eq 0">无<else />{$v.deadline|date="Y-m-d",###}</if></td>
		  <td><if condition="$v.uuid eq 0">无<else />{$v.nickname}({$v.uuid})</if></td>
		   <td>{$v.create_time}</td>
		  <td><a href="{:U('/Home/Media/media_order',array('media_id'=>$v['id']))}" class="tablelink">订单({$v['ordernum']+0})</a>
		  <!-- &nbsp;&nbsp;<a href="{:U('/Home/Media/special_list',array('mmid'=>$v['mmid']))}" class="tablelink">专辑</a> -->
		  <if condition="$founder neq 4">
		  &nbsp;&nbsp;<a href="{:U('/Home/Media/media_edit',array('mmid'=>$v['mmid']))}" class='<if condition="$v.articles eq '-17-'">tablelink_red<else />tablelink</if>'>修改</a></if>
		  <if condition="$v.collectpower eq 0"><else />
			<a href="javascript:void(0);" onclick="collectuser(<?php echo $v['id'];?>)" class="tablelink">签约</a>
			  <if condition="$founder neq 4">&nbsp;&nbsp;<a href="{:U('/Home/Media/words_add',array('mmid'=>$v['mmid']))}" class="tablelink">充值</a></if>
			  <a href="javascript:void(0);" onclick="remove_word({$v['mmid']})" class="tablelink">转移字数</a>
			  <!--<a href="{:U('/Home/Media/remove_words',array('mmid'=>$v['mmid']))}" class="tablelink">转移字数</a>-->
			</if>
		  </t
		</tr>
	   </foreach>
		</tbody>
	</table>
	<style>.pages a,.pages span {
	display:inline-block;
	padding:2px 5px;
	margin:0 1px;
	border:1px solid #f0f0f0;
	-webkit-border-radius:3px;
	-moz-border-radius:3px;
	border-radius:3px;
}
.pages a,.pages li {
	display:inline-block;
	list-style: none;
	text-decoration:none; color:#58A0D3;
}
.pages a.first,.pages a.prev,.pages a.next,.pages a.end{
	margin:0;
}
.pages a:hover{
	border-color:#50A8E6;
}
.pages span.current{
	background:#50A8E6;
	color:#FFF;
	font-weight:700;
	border-color:#50A8E6;
}</style>

   <div class="pages"><br />

						<div align="right">{$page}
						</div>
   </div>

	</div>

</body>
<!-- <script type="text/javascript" src="__PUBLIC__/admin/sncss/js/jquery.js"></script> -->
<!-- <script src="__PUBLIC__/js/jquery1.8.3.js"></script> -->
<script src="__PUBLIC__/admin/Js/jquery-1.7.2.min.js"></script>
<script src="__PUBLIC__/admin/Js/jquery.combo.select.js"></script>
<script src="__PUBLIC__/layer/layer.js"></script>
<script type="text/javascript">
	$('.tablelist tbody tr:odd').addClass('odd');
	$(function() {
		$('#u1_input').comboSelect();
	});
function collectuser(id){
	layer.open({title: false, type: 1, area: ['400px', '200px'], //宽高
		content: '<div class="mainlist" style="padding:30px;"><form id="form2" name="form2" method="post" action="/Home/User/user_binding" onsubmit="return form2_submit();">'
		+'<input id="uuid" name="uuid" class="dfinput" value="" />'
		+'<input name="mediaid"  type="hidden" class="dfinput" value="'+id+'" />'
		+'<br><br><input type="submit" class="btn" value="签约"/></form></div>'
	});
}
function remove_word(mmid){
	var url = "{:U('Home/Media/remove_words/mmid/"+mmid+"')}";
    layer.open({
        title: false, type: 2, area: ['600px', '500px'], //宽高
        content: url
    })
}
function form2_submit(){
	var uuid= $('#uuid').val();
	if(uuid.length==0){
			layer.msg('必须填主播编号');return false;
			// alert('必须填写理由');return false;
	}
}
</script>
</html>
